/*
 * @Author: Yzq
 * @Date: 2021-04-01 14:54:53
 * @LastEditTime: 2021-04-06 09:56:46
 * @LastEditors: Yzq
 */
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import TabScreen from './tabStack';

import Login from './login';
import User from './Dao/user';

const Stack = createStackNavigator();

export const Screens = {
  Login: {component: Login},
};

const AppStack = () => {
  return (
    <NavigationContainer>
      <Stack.Navigator
        screenOptions={() => {
          return {
            // tabBarVisitble: false, //隐藏底部
            headerShown: false, //隐藏头部
          };
        }}
        initialRouteName={User.username ? 'Tab' : 'Login'}>
        <Stack.Screen name="Login" component={Login} />
        <Stack.Screen name="Tab" component={TabScreen} />
      </Stack.Navigator>
    </NavigationContainer>
  );
};

export default AppStack;
